package javase.socket.net;

import java.io.*;
import java.net.*;

public class URLDemo02 {
	public static void main(String[] args) throws Exception {
		try {

			URL tirc = new URL("http://localhost:8080/");
			URLConnection con = tirc.openConnection();
			BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
			String inputLine;
			while ((inputLine = in.readLine()) != null) {
				System.out.println(inputLine);
			}

		} catch (Exception e) {
			System.out.println(e.toString());
		}
	}
}